#pragma once
//----------------------------------------------------------------------------------------------------------------
//			Filename:		Point2D.h
//			  Author:		Adrian De Barro
//			    Date:		12/08/2015
//----------------------------------------------------------------------------------------------------------------
//			  Status: REFACTORING
//----------------------------------------------------------------------------------------------------------------
#include <string>

using std::string;
using std::to_string;
namespace Engine
{
	//----------------------------------------------------------------------------------------------------------------
	//			Class Name: Point2D
	//		   Description: Basic object representing an X and a Y
	//----------------------------------------------------------------------------------------------------------------
	//			    Status: REFACTORING
	//----------------------------------------------------------------------------------------------------------------
	class Point2D
	{
	public:

		union
		{
			float x;
			float u;
		};

		union
		{
			float y;
			float v;
		};

		//----------------------------------------------------------------------------------------------------------------
		//		 Method Name: CONSTRUCTOR
		//		Return Value: VOID
		//		  Parameters: VOID
		//			  Status: READY
		//----------------------------------------------------------------------------------------------------------------
		Point2D(void)
		{
			x = 0;
			y = 0;
		}
		//----------------------------------------------------------------------------------------------------------------
		//		 Method Name: CONSTRUCTOR
		//		Return Value: VOID
		//		  Parameters: float coordinate
		//			  Status: READY
		//----------------------------------------------------------------------------------------------------------------
		Point2D(float c)
		{
			x = c;
			y = c;
		}
		//----------------------------------------------------------------------------------------------------------------
		//		 Method Name: CONSTRUCTOR
		//		Return Value: VOID
		//		  Parameters: 2D position
		//			  Status: READY
		//----------------------------------------------------------------------------------------------------------------
		Point2D(const Point2D& currentPoint)
		{
			x = currentPoint.x;
			y = currentPoint.y;
		}
		//----------------------------------------------------------------------------------------------------------------
		//		 Method Name: CONSTRUCTOR
		//		Return Value: VOID
		//		  Parameters: X coordinate, y Coordinate
		//			  Status: READY
		//----------------------------------------------------------------------------------------------------------------
		Point2D(float xCoor, float yCoor)
		{
			x = xCoor;
			y = yCoor;
		}

		string toString()
		{
			return to_string(x) + "," + to_string(y);
		}

		//----------------------------------------------------------------------------------------------------------------
		//		 Method Name: Set
		//		Return Value: VOID
		//		  Parameters: x coordinate, y coordinate
		//			  Status: READY
		//----------------------------------------------------------------------------------------------------------------
		void Set(float p_x, float p_y)
		{
			x = p_x;
			y = p_y;
		}
		//----------------------------------------------------------------------------------------------------------------
		//		 Method Name: DESTRUCTOR
		//		Return Value: VOID
		//		  Parameters: VOID
		//			  Status: READY
		//----------------------------------------------------------------------------------------------------------------
		~Point2D(void){}
		//----------------------------------------------------------------------------------------------------------------
		//		 Method Name: opertaor *
		//		Return Value: Point2D
		//		  Parameters: float constant
		//			  Status: READY
		//----------------------------------------------------------------------------------------------------------------
		inline Point2D operator *(float constant)
		{
			return (Point2D(x * constant, y * constant));
		}
	};
	//----------------------------------------------------------------------------------------------------------------
}
//----------------------------------------------------------------------------------------------------------------